package com.ds.lens.data.common.util;

import java.util.Map;

public class MapUtils {
    public static <T, E> Map<T, E> merge(Map<T, E> merged, Map<T, E>... maps) {
        if (merged == null) {
            throw new NullPointerException("merged map must not be null");
        }
        if (maps == null) {
            return merged;
        }
        for (Map<T, E> m : maps) {
            if (m != null) {
                merged.putAll(m);
            }
        }
        return merged;
    }
}
